package com.itheima.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

/**
 * @author Anomaly
 * @date 2023/2/9 16:56
 */
public class OutputStreamDemo {
    public static void main(String[] args) throws IOException {
        OutputStream os = new FileOutputStream("file-io/src/test.txt");
        os.write('a');
        os.write(100);
        os.write(new byte[]{65, 66, 67});
        os.write("\r\n".getBytes(StandardCharsets.UTF_8));
        os.write("嘿嘿嘿".getBytes(StandardCharsets.UTF_8));
        os.flush();
        os.close();
    }
}
